import { AxiosResponse, InternalAxiosRequestConfig } from 'axios'

import {
  handlerErrorCode,
  handlerRequstConfig,
  handlerSucessResponse
} from './handlerInterceptor'

export const requestInterceptor = (config: InternalAxiosRequestConfig) => {
  return handlerRequstConfig(config)
}

export const requestInterceptorCatch = (error: any) => {
  return error
}

export const responseInterceptor = (response: AxiosResponse) => {
  return handlerSucessResponse(response)
}

export const responseInterceptorCatch = (error: any) => {
  return handlerErrorCode(error)
}
